from django.core import serializers

def serialize_dishes(dishes):    
    #, extras=('get_thumbnail_url', 'medium_img_url', 'is_liked_by_curr_user', 'is_disliked_by_curr_user', 'is_okd_by_curr_user', 'get_place_name'), relations=('dishimage_set',), use_natural_keys=True)

    return serializers.serialize('json', dishes, indent=4, extras=('get_locations', 'get_display_image_src', 'get_thumbnail_image_src', ), relations=('place', 'pic', ))
    
    
#def serialize_ranks(ranks):
#    return serializers.serialize('json', ranks, use_natural_keys=True)

# def serialize_reviews(reviews, user):
    # return serializers.serialize('json', reviews, extras=('get_user_profile_icon_url', 'get_username'), use_natural_keys=True) # extras must be list!!! i.e. add a comma after first string

#def serialize_dish_photos_urls(photos):
#    return serializers.serialize('json', photos, extras=('get_thumbnail_url',), use_natural_keys=True)